package com.qfan.springaimcpdemo;

import com.qfan.springaimcpdemo.service.SearchService;
import com.qfan.springaimcpdemo.service.WeatherService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class SpringAiMcpDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringAiMcpDemoApplication.class, args);
    }

//    /**
//     * 注册工具
//     * @param weatherService
//     * @return
//     */
//    @Bean
//    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
//        return MethodToolCallbackProvider.builder().toolObjects(weatherService).build();
//    }

    @Bean
    public ToolCallbackProvider serverTools(SearchService searchService) {
        return MethodToolCallbackProvider.builder().toolObjects(searchService).build();
    }
}
